package biz.datalk.industrialland.common.util;

import org.springframework.context.i18n.LocaleContextHolder;

import java.util.Locale;

/**
 * 返回值消息
 * @author tarofang@163.com
 * @date 2019-08-17
 */
@SuppressWarnings({"unused", "WeakerAccess"})
public class I18NUtil {

    public static String getMsg(String code, String... args) {
        return getMsg(LocaleContextHolder.getLocale(), code, args);
    }

    public static String getMsg(Locale locale, String code, String... args) {
        return SpringContextUtils.getApplicationContext().getMessage(code, args, locale);
    }
}
